﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>NBlock快速开发框架</title>
    <link rel="shortcut icon" href="http://www.google.com/favicon.ico" />
    @Html.Css("main", "layout", "tree", "tabpanel", "dialog")
</head>
<body>
    <div class="main-panel">
        <div class="top">
            <span class="logotitle">NBlock快速开发框架</span><span class="welcome">欢迎您，@ViewBag.UserName&nbsp;&nbsp;&nbsp
            <a href="/User/ChangePassword" class="normal"><span class="logout">修改密码</span></a>&nbsp;&nbsp;
            <a href="/Home/Logout" class="normal"><span class="logout">注销</span></a></span>
        </div>
        <div class="left">
            <div id="panel-header" class="x-panel-header">
                <span class="menupanel">菜单 </span>
            </div>
            <div class="x-panel-bwrap">
                <div id="panel-wrap" class="x-panel-body">
                    <div id="treepanel" class="menutree">
                        <!--menu tree -->
                    </div>
                </div>
            </div>
        </div>
        <div id="tab-container" class="x-tab-panel x-border-panel" style="left: 180px; top: 53px;">
        </div>
        <div class="bottom">
            Copyright &copy; 2012 NBlock快速开发框架
        </div>
        <div id="portal" style="display: none">
            @{Html.RenderPartial("Portal");}
        </div>
    </div>
</body>
</html>
@Html.Js("jquery", "common", "tree", "tabpanel", "dialog", "easydrag")
<script src="@Url.Action("Menu")" type="text/javascript"></script>
<script type="text/javascript">
    $(document).ready(function () {
        var browser = navigator.appName
        var b_version = navigator.appVersion
        var version = b_version.split(";");
        var trim_Version = version[1].replace(/[ ]/g, "");
        if (!(browser == "Microsoft Internet Explorer" && trim_Version == "MSIE9.0")) {
            location.href = "http://www.iefans.net/ie9-xiazai-jianti-zhongwenban/";
            return;
        }

        // 计算高度
        var mainh = document.documentElement.clientHeight;
        var mainw = document.documentElement.clientWidth;
        var panelheader = $("#panel-header").outerHeight(); // 左边菜单表头的高度
        var header = 58;
        var bottom = 30;

        // 左边菜单
        var op = { data: menudata, onnodeclick: navi, emptyiconpath: "/Content/themes/Blue/images/icons/s.gif", cbiconpath: "/Content/themes/Blue/images/icons/" };
        function navi(item) {
            if (item.value) {
                OpenTabItem(item.id, item.text, item.value);
            }
            else {
                item.expand();
            }
        }
        $("#treepanel").treeview(op);

        // 右边Tab控件
        var tabo = {};
        tabo.items = [{ id: "home", text: "主页", classes: "icon_home", isactive: true, content: $("#portal").html()}];
        tabo.width = mainw - 180;
        tabo.height = mainh - header - bottom - 2;
        $("#tab-container").tabpanel(tabo);

        // 设置窗口大小并注册窗口改变时重置大小的事件
        setpanelsize();
        function setpanelsize() {
            mainh = document.documentElement.clientHeight;
            mainw = document.documentElement.clientWidth;
            var h = mainh - header - panelheader - bottom;
            var w = mainw - 180;
            $("#panel-wrap").height(h);
            $("#tab-container").width(w);
        }
        $(window).resize(window_resize);
        function window_resize() {
            setpanelsize();
            $("#tab-container").resizetabpanel(mainw - 180, mainh - header - bottom - 2);
        }
    });

    //  打开Tab项
    function OpenTabItem(id, text, url) {
        var item = {
            id: id.replace(/[^a-zA-Z\d_]/ig, "_"),
            text: text,
            url: url,
            isactive: true,
            closeable: true
        };
        $("#tab-container").opentabitem(item, true);
    }
</script>
